//
//  MBProgressHUD+HUB.m
//  SOSTVCN
//
//  Created by 李佳楠 on 2017/4/11.
//  Copyright © 2017年 lee. All rights reserved.
//

#import "MBProgressHUD+HUB.h"

@implementation MBProgressHUD (HUB)
+(void)showTheMessage:(NSString *)message with:(UIView *)view
{
    UIView *showView;
    if (view) {
        showView = view;
    }
    else
    {
        showView = [UIApplication sharedApplication].keyWindow;
        if (!showView) {
             showView = [UIApplication sharedApplication].windows.lastObject;
        }
    }
    MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:showView animated:YES];
    

    hub.center = CGPointMake(kWidth / 2, kHeight - 125 * multipeH);
    hub.bounds = CGRectMake(0, 0, 300 * multipe, 50 * multipeH);
    hub.backgroundColor = [UIColor colorWithHexString:@"#1A1A1A"];
    hub.alpha = 0.85f;
    hub.layer.cornerRadius = 10 * multipeH;
    hub.layer.masksToBounds = YES;
    UILabel *label = [[UILabel alloc]initWithFrame:hub.bounds];
    label.backgroundColor = hub.backgroundColor;
    label.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
    label.text= message;
    label.font = [UIFont boldSystemFontOfSize:24 * multipe];
    label.textAlignment = NSTextAlignmentCenter;
    [hub addSubview:label];
    hub.removeFromSuperViewOnHide = YES;
    [hub hideAnimated:YES afterDelay:2];
    
}

@end
